.class public Lcom/htc/android/footprints/activity/SnapshotActivity;
.super Landroid/app/Activity;
.source "SnapshotActivity.java"


# static fields
.field public static final MENU_TAKE_SNAPSHOT:I = 0x0

.field private static final TAG:Ljava/lang/String; = "SnapshotActivity"


# instance fields
.field private mFootprint:Lcom/htc/android/footprints/vo/Footprint;

.field private mSnapshot:Lcom/htc/android/footprints/view/Snapshot;

.field private mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 16
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 18
    iput-object v0, p0, Lcom/htc/android/footprints/activity/SnapshotActivity;->mSnapshot:Lcom/htc/android/footprints/view/Snapshot;

    .line 19
    iput-object v0, p0, Lcom/htc/android/footprints/activity/SnapshotActivity;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    return-void
.end method


# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
    .locals 2
    .parameter "icicle"

    .prologue
    .line 23
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 25
    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/activity/SnapshotActivity;->requestWindowFeature(I)Z

    .line 26
    const v0, 0x7f03001f

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/activity/SnapshotActivity;->setContentView(I)V

    .line 28
    const v0, 0x7f0c0094

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/activity/SnapshotActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/htc/android/footprints/view/Snapshot;

    iput-object v0, p0, Lcom/htc/android/footprints/activity/SnapshotActivity;->mSnapshot:Lcom/htc/android/footprints/view/Snapshot;

    .line 30
    invoke-virtual {p0}, Lcom/htc/android/footprints/activity/SnapshotActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string v1, "DATA"

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v0

    check-cast v0, Lcom/htc/android/footprints/vo/Footprint;

    iput-object v0, p0, Lcom/htc/android/footprints/activity/SnapshotActivity;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    .line 32
    iget-object v0, p0, Lcom/htc/android/footprints/activity/SnapshotActivity;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    if-eqz v0, :cond_0

    .line 33
    iget-object v0, p0, Lcom/htc/android/footprints/activity/SnapshotActivity;->mSnapshot:Lcom/htc/android/footprints/view/Snapshot;

    iget-object v1, p0, Lcom/htc/android/footprints/activity/SnapshotActivity;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    invoke-virtual {v0, v1}, Lcom/htc/android/footprints/view/Snapshot;->initPostcard(Lcom/htc/android/footprints/vo/Footprint;)V

    .line 35
    :cond_0
    iget-object v0, p0, Lcom/htc/android/footprints/activity/SnapshotActivity;->mSnapshot:Lcom/htc/android/footprints/view/Snapshot;

    invoke-virtual {v0}, Lcom/htc/android/footprints/view/Snapshot;->invalidate()V

    .line 36
    new-instance v0, Lcom/htc/android/footprints/utils/StorageUtil;

    invoke-virtual {p0}, Lcom/htc/android/footprints/activity/SnapshotActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/htc/android/footprints/utils/StorageUtil;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/htc/android/footprints/activity/SnapshotActivity;->mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

    .line 37
    iget-object v0, p0, Lcom/htc/android/footprints/activity/SnapshotActivity;->mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

    new-instance v1, Lcom/htc/android/footprints/activity/SnapshotActivity$1;

    invoke-direct {v1, p0}, Lcom/htc/android/footprints/activity/SnapshotActivity$1;-><init>(Lcom/htc/android/footprints/activity/SnapshotActivity;)V

    invoke-virtual {v0, v1}, Lcom/htc/android/footprints/utils/StorageUtil;->SetOnChangeStorageListerner(Lcom/htc/android/footprints/utils/StorageUtil$OnChangeStorageListener;)V

    .line 45
    return-void
.end method

.method public onCreateOptionsMenu(Landroid/view/Menu;)Z
    .locals 3
    .parameter "menu"

    .prologue
    const/4 v2, 0x0

    .line 51
    invoke-virtual {p0}, Lcom/htc/android/footprints/activity/SnapshotActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f0a007e

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v2, v2, v2, v0}, Landroid/view/Menu;->add(IIILjava/lang/CharSequence;)Landroid/view/MenuItem;

    .line 54
    const/4 v0, 0x1

    return v0
.end method

.method public onOptionsItemSelected(Landroid/view/MenuItem;)Z
    .locals 1
    .parameter "item"

    .prologue
    .line 59
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v0

    if-nez v0, :cond_0

    .line 60
    iget-object v0, p0, Lcom/htc/android/footprints/activity/SnapshotActivity;->mSnapshot:Lcom/htc/android/footprints/view/Snapshot;

    invoke-virtual {v0}, Lcom/htc/android/footprints/view/Snapshot;->takeSnapshot()V

    .line 62
    :cond_0
    const/4 v0, 0x1

    return v0
.end method

.method protected onPause()V
    .locals 1

    .prologue
    .line 67
    invoke-super {p0}, Landroid/app/Activity;->onPause()V

    .line 68
    iget-object v0, p0, Lcom/htc/android/footprints/activity/SnapshotActivity;->mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

    if-eqz v0, :cond_0

    .line 69
    iget-object v0, p0, Lcom/htc/android/footprints/activity/SnapshotActivity;->mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

    invoke-virtual {v0}, Lcom/htc/android/footprints/utils/StorageUtil;->closeStorgaeUtil()V

    .line 71
    :cond_0
    return-void
.end method
